package com.best.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.best.entity.Employee;
import com.best.service.EmployeeService;

@Controller
@RequestMapping("/view/user")
public class UserController {
	private static Log log = LogFactory.getLog("user");
	@Resource
	private EmployeeService employeeServiceImpl;

	@RequestMapping("/test")
	public ModelAndView userinfo(ModelMap result, HttpServletRequest request) {
		log.error("33333333333333");
		result.put("key", 123);
		return new ModelAndView("test");
	}
	
	@RequestMapping("/testJson")
	public @ResponseBody Employee testJson(ModelMap result, HttpServletRequest request) {
		return employeeServiceImpl.findByPK(1);
	}
	
}
